package com.ld.xuanKe.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.ld.xuanKe.util.TimestampStringConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import java.sql.Timestamp;

/**
 * @ProjectName xuanKe
 * @ClassName Course
 * @Author 刘邓
 * @Date 2023-12-09 10:37
 */
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Course {
	@javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.IDENTITY)
	@javax.persistence.Id
	@javax.persistence.Column(name = "id", nullable = false)
	@ExcelProperty("课程ID")
	private Integer id;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "name", nullable = false, length = 255)
	@ExcelProperty("课程名")
	private String name;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "teacher", nullable = false, length = 255)
	@ExcelProperty("授课教师")
	private String teacher;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "capacity", nullable = false)
	@ExcelProperty("课程容量")
	private Integer capacity;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "start_time", nullable = true)
	@ExcelProperty(value = "选课开始时间",converter = TimestampStringConverter.class)
	private Timestamp startTime;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "end_time", nullable = true)
	@ExcelProperty(value = "选课结束时间",converter = TimestampStringConverter.class)
	private Timestamp endTime;



	@javax.persistence.Basic
	@javax.persistence.Column(name = "selected", nullable = true)
	@ExcelProperty("已选人数")
	private Integer selected;
	@javax.persistence.Basic
	@javax.persistence.Column(name = "bz", nullable = true)
	@ExcelProperty("课程说明")
	private String bz;
	@javax.persistence.Basic
	@javax.persistence.Column(name = "xf", nullable = true)
	@ExcelProperty("学分")
	private Float xf;
}
